<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});

Route::get('hello/:name', 'index/Hello');


//验证码
Route::get('captcha','User/verify');

Route::post('register', 'User/register')
    ->validate([
        'userName' => 'require|max:25',
        'password' => 'require|min:6',
        'phone' => 'require|number|min:11',
    ]);
Route::post('login', 'User/login')
    ->validate([
        'userName' => 'require|max:25',
        'password' => 'require|min:6',
    ]);
Route::get('userInfo', 'User/userInfo');

Route::get('article', 'Article/index');

//发布更新文章
Route::post('article/update', 'Article/updateArticle')->validate(\app\middleware\ArticleValidate::class);

//文章评论
Route::post('article/addComment', 'Discuss/index')->validate(\app\middleware\DiscussValidate::class);

//文章点赞
Route::post('article/like', 'Article/articleLike')->validate([
    'uid' => 'require',
    'articleId' => 'require',
]);

//文章收藏
Route::post('article/collect', 'Article/articleCollect')->validate([
    'uid' => 'require',
    'articleId' => 'require',
]);
//图片上传
Route::post('upload/img', 'UploadFile/uploadImg');

//文章统计
Route::get('statistics', 'articleStatistics/index');

Route::post('resigin', 'index/resigin');

//用户列表
Route::get('user/list', 'User/userList');

//用户编辑
Route::put('user/edit', 'User/editUser');


